﻿using System.Collections.Generic;
using PerceptiveMCAPI.Types;
//
namespace PerceptiveMCAPI
{
	internal static partial class ValidateInput
	{
		// lists
		internal static List<Api_ValidatorMessage> Validate( listsInput input )
		{
			List<Api_ValidatorMessage> messages = ValidateBaseParameters( input as Api_BaseInput );
			Api_ValidatorMessage val;
			//-----------------------
			// apikey
			val = Validator.apikey_valid( input.parms.apikey );
			if ( val != null ) messages.Add( val );
			// start
			val = Validator.start_valid( input.parms.start );
			if ( val != null ) messages.Add( val );
			// limit
			val = Validator.limit_valid( input.parms.limit, MCAPISettings.max_lists );
			if ( val != null ) messages.Add( val );

			// filters, none are required 
			if ( input.parms.filters.Count > 0 )
			{
				List<Api_ValidatorMessage> val_list = lists_Validator.filters_valid( input.parms.filters );
				foreach ( Api_ValidatorMessage msg in val_list )
				{
					messages.Add( msg );
				}
			}
			//--------------------
			return messages;
		}
	}
}
